function SpawnEnemys()
	local entities = 	ents.GetAll( )
	for _, ent in ipairs( entities ) do
		local name = ent:GetName()
		if (name == "npc_Enemy1") then
			local flakz = ents.Create( "npc_Enemy1" )
			if ( !flakz:IsValid() ) then return end
			flakz:SetPos(ent:GetPos())
			flakz:SetAngles(Angle(0,0,0)) 
			flakz:Spawn()
			flakz:Initialize()
			flakz:Activate()
			flakz.orginalposition = ent:GetPos()
			flakz:GetPhysicsObject():EnableGravity( false ) 
		end
		if (name == "Mine") then
			local flakz = ents.Create( "mine" )
			if ( !flakz:IsValid() ) then return end
			flakz:SetPos(ent:GetPos())
			flakz:SetAngles(Angle(0,0,0)) 
			flakz:Spawn()
			flakz:Initialize()
			flakz:Activate()
			flakz.orginalposition = ent:GetPos()
			flakz:GetPhysicsObject():EnableGravity( false ) 
		end
	end		
end

function respawnnpc(class,pos)
	local flakz = ents.Create( class )
	if ( !flakz:IsValid() ) then return end
	flakz:SetPos(pos)
	flakz:SetAngles(Angle(0,0,0)) 
	Msg("Adding Npc \n")
	flakz:Spawn()
	flakz:Initialize()
	flakz:Activate()
	flakz.orginalposition = pos
	flakz:GetPhysicsObject():EnableGravity( false ) 
end

function Waitabit()
	timer.Create("Wait until zones are done",10,1,SpawnEnemys)
end	
hook.Add( "InitPostEntity", "Waitabit", Waitabit );  